package cn.lili.modules.promotion.client;

import cn.lili.modules.constant.ServiceConstant;
import cn.lili.modules.goods.entity.dos.Goods;
import cn.lili.modules.promotion.entity.dos.BoxMhgoods;
import cn.lili.modules.promotion.entity.dos.BoxMhgoodsTag;
import cn.lili.modules.promotion.entity.dto.CallbackBlindboxDTO;
import cn.lili.modules.promotion.fallback.BlindboxCountClientFallback;
import cn.lili.modules.promotion.fallback.BoxMhGoodsClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(path = "${server.servlet.context-path}", name = ServiceConstant.PROMOTION_SERVICE, contextId = "box-mh-goods-client", fallback = BoxMhGoodsClientFallback.class)
public interface BoxMhGoodsClient {

    /**
     * 下单后更新盲盒数据
     * */
    @PostMapping("/callbackMhGoods")
    List<Goods> callbackMhGoods(@RequestBody CallbackBlindboxDTO callbackBlindboxDTO);

    @GetMapping("/feign/removeGoodsMh")
    Boolean removeGoodsMh(@RequestParam String mhId,@RequestParam String id);

    @GetMapping("/feign/getById")
    BoxMhgoods getById(@RequestParam String mhId);

    @GetMapping("/feign/getByIds")
    List<BoxMhgoods> getByIds(@RequestParam String mhIds);

    @GetMapping("/feign/getBiZhongGoodsById")
    Long getBiZhongGoodsById(@RequestParam String id);

    @GetMapping("/feign/getTagListById")
    List<BoxMhgoodsTag> getTagListById(@RequestParam String mhId);
}
